using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Item : MonoBehaviour
{
    public bool inWater;
    public float invincibleTime;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (GameManager.Instance.isPause)
            return;

        invincibleTime -= Time.deltaTime;
        if (transform.position.y <= -10.0f)
            Destroy(gameObject);
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (invincibleTime > 0.0f)
            return;
        var curGlove = collision.GetComponent<Glove>();
        if (curGlove)
        {
            UsedByGlove(curGlove);
        }
    }

    public virtual void UsedByGlove(Glove curGlove)
    {

    }
}
